.class public Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;
.super Landroid/widget/ArrayAdapter;
.source "TracksAdapterWithMap.java"

# interfaces
.implements Lse/emilsjolander/stickylistheaders/StickyListHeadersAdapter;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/widget/ArrayAdapter<",
        "Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;",
        ">;",
        "Lse/emilsjolander/stickylistheaders/StickyListHeadersAdapter;"
    }
.end annotation


# instance fields
.field private area_units:Ljava/lang/String;

.field protected ctx:Landroid/app/Activity;

.field private db:Llt/noframe/gpsfarmguide/database/DB;

.field private distance_units:Ljava/lang/String;

.field private draw:Llt/noframe/gpsfarmguide/utils/Drawing;

.field private list:Landroid/widget/ListView;

.field myFilter:Landroid/widget/Filter;

.field protected originalTracks:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;",
            ">;"
        }
    .end annotation
.end field

.field private polygons:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap<",
            "Ljava/lang/Integer;",
            "Lcom/google/android/gms/maps/model/PolygonOptions;",
            ">;"
        }
    .end annotation
.end field

.field private savedInstanceState:Landroid/os/Bundle;

.field protected tracks:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Landroid/app/Activity;Ljava/util/List;Landroid/os/Bundle;Landroid/widget/ListView;)V
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/app/Activity;",
            "Ljava/util/List<",
            "Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;",
            ">;",
            "Landroid/os/Bundle;",
            "Landroid/widget/ListView;",
            ")V"
        }
    .end annotation

    const/4 v0, 0x0

    .line 61
    invoke-direct {p0, p1, v0, p2}, Landroid/widget/ArrayAdapter;-><init>(Landroid/content/Context;ILjava/util/List;)V

    .line 250
    new-instance v0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap$2;

    invoke-direct {v0, p0}, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap$2;-><init>(Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;)V

    iput-object v0, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->myFilter:Landroid/widget/Filter;

    .line 62
    iput-object p1, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->ctx:Landroid/app/Activity;

    .line 63
    iput-object p2, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->tracks:Ljava/util/List;

    .line 64
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0, p2}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V

    iput-object v0, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->originalTracks:Ljava/util/List;

    .line 65
    iput-object p4, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->list:Landroid/widget/ListView;

    .line 66
    new-instance p4, Llt/noframe/gpsfarmguide/utils/Drawing;

    invoke-direct {p4}, Llt/noframe/gpsfarmguide/utils/Drawing;-><init>()V

    iput-object p4, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->draw:Llt/noframe/gpsfarmguide/utils/Drawing;

    .line 67
    new-instance p4, Ljava/util/HashMap;

    invoke-direct {p4}, Ljava/util/HashMap;-><init>()V

    iput-object p4, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->polygons:Ljava/util/HashMap;

    .line 68
    iput-object p3, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->savedInstanceState:Landroid/os/Bundle;

    .line 70
    invoke-static {p1}, Llt/noframe/gpsfarmguide/utils/Preferences;->getDistanceUnit(Landroid/content/Context;)Ljava/lang/String;

    move-result-object p3

    iput-object p3, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->distance_units:Ljava/lang/String;

    .line 71
    invoke-static {p1}, Llt/noframe/gpsfarmguide/utils/Preferences;->getAreaUnit(Landroid/content/Context;)Ljava/lang/String;

    move-result-object p3

    iput-object p3, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->area_units:Ljava/lang/String;

    .line 73
    new-instance p3, Llt/noframe/gpsfarmguide/database/DB;

    invoke-direct {p3, p1}, Llt/noframe/gpsfarmguide/database/DB;-><init>(Landroid/content/Context;)V

    iput-object p3, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->db:Llt/noframe/gpsfarmguide/database/DB;

    .line 74
    iget-object p1, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->ctx:Landroid/app/Activity;

    invoke-static {p1}, Lcom/google/android/gms/maps/MapsInitializer;->initialize(Landroid/content/Context;)I

    if-eqz p2, :cond_0

    .line 77
    invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object p1

    :goto_0
    invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z

    move-result p2

    if-eqz p2, :cond_0

    invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object p2

    check-cast p2, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    .line 78
    invoke-virtual {p2}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->calculateCorrdinates()V

    goto :goto_0

    :cond_0
    return-void
.end method

.method static synthetic access$000(Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;)Landroid/os/Bundle;
    .locals 0

    .line 43
    iget-object p0, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->savedInstanceState:Landroid/os/Bundle;

    return-object p0
.end method

.method static synthetic access$100(Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;Lcom/google/android/gms/maps/GoogleMap;Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;)V
    .locals 0

    .line 43
    invoke-direct {p0, p1, p2}, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->addPolygon(Lcom/google/android/gms/maps/GoogleMap;Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;)V

    return-void
.end method

.method static synthetic access$200(Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;)Landroid/widget/ListView;
    .locals 0

    .line 43
    iget-object p0, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->list:Landroid/widget/ListView;

    return-object p0
.end method

.method private addPolygon(Lcom/google/android/gms/maps/GoogleMap;Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;)V
    .locals 3

    .line 184
    invoke-virtual {p1}, Lcom/google/android/gms/maps/GoogleMap;->clear()V

    .line 187
    invoke-virtual {p2}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getField()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    if-eqz v0, :cond_1

    .line 189
    iget-object v0, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->polygons:Ljava/util/HashMap;

    invoke-virtual {p2}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getField()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v1

    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->getId()I

    move-result v1

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 190
    iget-object v0, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->polygons:Ljava/util/HashMap;

    invoke-virtual {p2}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getField()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v1

    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->getId()I

    move-result v1

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/google/android/gms/maps/model/PolygonOptions;

    invoke-virtual {p1, v0}, Lcom/google/android/gms/maps/GoogleMap;->addPolygon(Lcom/google/android/gms/maps/model/PolygonOptions;)Lcom/google/android/gms/maps/model/Polygon;

    goto :goto_0

    .line 192
    :cond_0
    iget-object v0, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->draw:Llt/noframe/gpsfarmguide/utils/Drawing;

    invoke-virtual {p2}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getField()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v1

    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getPoints()Ljava/util/List;

    move-result-object v1

    invoke-virtual {v0, v1}, Llt/noframe/gpsfarmguide/utils/Drawing;->loadField(Ljava/util/List;)Lcom/google/android/gms/maps/model/PolygonOptions;

    move-result-object v0

    .line 193
    invoke-virtual {p1, v0}, Lcom/google/android/gms/maps/GoogleMap;->addPolygon(Lcom/google/android/gms/maps/model/PolygonOptions;)Lcom/google/android/gms/maps/model/Polygon;

    .line 194
    iget-object v1, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->polygons:Ljava/util/HashMap;

    invoke-virtual {p2}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getField()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v2

    invoke-virtual {v2}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->getId()I

    move-result v2

    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-virtual {v1, v2, v0}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 197
    :cond_1
    :goto_0
    invoke-virtual {p2, p1}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->showTrackSpec(Lcom/google/android/gms/maps/GoogleMap;)V

    .line 199
    invoke-virtual {p2}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getCoordinates()Ljava/util/List;

    move-result-object p2

    invoke-static {p1, p2}, Llt/noframe/gpsfarmguide/utils/CameraFunctions;->fixZoom(Lcom/google/android/gms/maps/GoogleMap;Ljava/util/List;)V

    return-void
.end method

.method private setMap(Landroid/view/View;Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;)V
    .locals 1

    .line 93
    new-instance v0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap$1;

    invoke-direct {v0, p0, p1, p2}, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap$1;-><init>(Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;Landroid/view/View;Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;)V

    .line 122
    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    return-void
.end method


# virtual methods
.method protected generateView(ILandroid/view/View;)Landroid/view/View;
    .locals 11

    .line 132
    iget-object v0, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->ctx:Landroid/app/Activity;

    const-string v1, "layout_inflater"

    invoke-virtual {v0, v1}, Landroid/app/Activity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/LayoutInflater;

    .line 133
    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->getItem(I)Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    move-result-object p1

    if-nez p2, :cond_0

    const p2, 0x7f0c0073

    const/4 v1, 0x0

    .line 135
    invoke-virtual {v0, p2, v1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    .line 136
    invoke-direct {p0, p2, p1}, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->setMap(Landroid/view/View;Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;)V

    :cond_0
    if-eqz p1, :cond_3

    .line 139
    invoke-virtual {p2}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/google/android/gms/maps/GoogleMap;

    const v1, 0x7f09018c

    .line 140
    invoke-virtual {p2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    .line 141
    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getName()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    const v1, 0x7f09020b

    .line 143
    invoke-virtual {p2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    .line 144
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    iget-object v3, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->ctx:Landroid/app/Activity;

    const v4, 0x7f11002f

    invoke-virtual {v3, v4}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v3, " "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getArea()D

    move-result-wide v4

    iget-object v6, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->area_units:Ljava/lang/String;

    invoke-static {v4, v5, v6}, Llt/noframe/gpsfarmguide/utils/Mathematics;->convertArea(DLjava/lang/String;)D

    move-result-wide v4

    invoke-static {v4, v5}, Llt/noframe/gpsfarmguide/utils/Utils;->smartRounding(D)D

    move-result-wide v4

    invoke-virtual {v2, v4, v5}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v4, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->area_units:Ljava/lang/String;

    invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    const v1, 0x7f090279

    .line 146
    invoke-virtual {p2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    .line 147
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    iget-object v4, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->ctx:Landroid/app/Activity;

    const v5, 0x7f1100b1

    invoke-virtual {v4, v5}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getDistance()D

    move-result-wide v4

    iget-object v6, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->distance_units:Ljava/lang/String;

    invoke-static {v4, v5, v6}, Llt/noframe/gpsfarmguide/utils/Mathematics;->convertDistance(DLjava/lang/String;)D

    move-result-wide v4

    invoke-static {v4, v5}, Llt/noframe/gpsfarmguide/utils/Utils;->smartRounding(D)D

    move-result-wide v4

    invoke-virtual {v2, v4, v5}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v4, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->distance_units:Ljava/lang/String;

    invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    const v1, 0x7f09025d

    .line 150
    invoke-virtual {p2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    .line 151
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    iget-object v4, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->ctx:Landroid/app/Activity;

    const v5, 0x7f1101e5

    invoke-virtual {v4, v5}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getTimeWasted()J

    move-result-wide v4

    invoke-static {v4, v5}, Llt/noframe/gpsfarmguide/utils/Utils;->setElapsedTime(J)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 152
    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getTimeWasted()J

    move-result-wide v4

    const/4 v2, 0x0

    const/16 v6, 0x8

    const-wide/16 v7, 0x0

    cmp-long v9, v4, v7

    if-lez v9, :cond_1

    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setVisibility(I)V

    goto :goto_0

    .line 153
    :cond_1
    invoke-virtual {v1, v6}, Landroid/widget/TextView;->setVisibility(I)V

    :goto_0
    const v1, 0x7f090223

    .line 155
    invoke-virtual {p2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    const v4, 0x7f0900f9

    .line 156
    invoke-virtual {p2, v4}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Landroid/widget/TextView;

    .line 157
    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    iget-object v9, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->ctx:Landroid/app/Activity;

    const v10, 0x7f1101d5

    invoke-virtual {v9, v10}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v5, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v5, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getStartDate()J

    move-result-wide v9

    invoke-static {v9, v10}, Llt/noframe/gpsfarmguide/utils/Utils;->longToDate(J)Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v5, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v1, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 158
    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    iget-object v9, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->ctx:Landroid/app/Activity;

    const v10, 0x7f1100c3

    invoke-virtual {v9, v10}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v5, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v5, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getEndDate()J

    move-result-wide v9

    invoke-static {v9, v10}, Llt/noframe/gpsfarmguide/utils/Utils;->longToDate(J)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v5, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v4, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 160
    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getStartDate()J

    move-result-wide v9

    cmp-long v3, v9, v7

    if-lez v3, :cond_2

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getEndDate()J

    move-result-wide v9

    cmp-long v3, v9, v7

    if-lez v3, :cond_2

    .line 161
    invoke-virtual {v1, v2}, Landroid/widget/TextView;->setVisibility(I)V

    .line 162
    invoke-virtual {v4, v2}, Landroid/widget/TextView;->setVisibility(I)V

    goto :goto_1

    .line 165
    :cond_2
    invoke-virtual {v1, v6}, Landroid/widget/TextView;->setVisibility(I)V

    .line 166
    invoke-virtual {v4, v6}, Landroid/widget/TextView;->setVisibility(I)V

    :goto_1
    if-eqz v0, :cond_3

    .line 170
    invoke-direct {p0, v0, p1}, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->addPolygon(Lcom/google/android/gms/maps/GoogleMap;Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;)V

    :cond_3
    return-object p2
.end method

.method public getCount()I
    .locals 1

    .line 227
    iget-object v0, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->tracks:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    return v0
.end method

.method public getFilter()Landroid/widget/Filter;
    .locals 1

    .line 247
    iget-object v0, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->myFilter:Landroid/widget/Filter;

    return-object v0
.end method

.method public getHeaderId(I)J
    .locals 2

    .line 299
    iget-object v0, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->tracks:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getField_id()I

    move-result p1

    int-to-long v0, p1

    return-wide v0
.end method

.method public getHeaderView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 2

    .line 283
    check-cast p2, Landroid/widget/TextView;

    if-nez p2, :cond_0

    .line 285
    iget-object p2, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->ctx:Landroid/app/Activity;

    invoke-static {p2}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object p2

    const v0, 0x7f0c006f

    const/4 v1, 0x0

    invoke-virtual {p2, v0, p3, v1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object p2

    check-cast p2, Landroid/widget/TextView;

    .line 288
    :cond_0
    :try_start_0
    iget-object p3, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->tracks:Ljava/util/List;

    invoke-interface {p3, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getField()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->getName()Ljava/lang/String;

    move-result-object p1

    invoke-virtual {p2, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    const-string p1, "Unknown"

    .line 290
    invoke-virtual {p2, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    :goto_0
    return-object p2
.end method

.method public bridge synthetic getItem(I)Ljava/lang/Object;
    .locals 0

    .line 43
    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->getItem(I)Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    move-result-object p1

    return-object p1
.end method

.method public getItem(I)Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;
    .locals 1

    .line 232
    iget-object v0, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->tracks:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    return-object p1
.end method

.method public getItemId(I)J
    .locals 2

    .line 237
    invoke-virtual {p0, p1}, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->getItem(I)Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    move-result-object p1

    invoke-virtual {p1}, Ljava/lang/Object;->hashCode()I

    move-result p1

    int-to-long v0, p1

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 0

    .line 128
    invoke-virtual {p0, p1, p2}, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->generateView(ILandroid/view/View;)Landroid/view/View;

    move-result-object p1

    return-object p1
.end method

.method public hasStableIds()Z
    .locals 1

    const/4 v0, 0x1

    return v0
.end method

.method public removeItem(I)V
    .locals 3

    const/4 v0, 0x0

    const/4 v1, 0x0

    .line 207
    :goto_0
    iget-object v2, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->tracks:Ljava/util/List;

    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v2

    if-ge v1, v2, :cond_1

    .line 208
    iget-object v2, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->tracks:Ljava/util/List;

    invoke-interface {v2, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    invoke-virtual {v2}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getId()I

    move-result v2

    if-ne p1, v2, :cond_0

    .line 210
    iget-object p1, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->tracks:Ljava/util/List;

    invoke-interface {p1, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    goto :goto_1

    :cond_0
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    :cond_1
    const/4 p1, 0x0

    :goto_1
    if-nez p1, :cond_2

    .line 214
    invoke-virtual {p0}, Landroid/widget/ArrayAdapter;->notifyDataSetChanged()V

    return-void

    .line 216
    :cond_2
    :goto_2
    iget-object v1, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->originalTracks:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    if-ge v0, v1, :cond_4

    .line 217
    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getId()I

    move-result v1

    iget-object v2, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->originalTracks:Ljava/util/List;

    invoke-interface {v2, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    invoke-virtual {v2}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getId()I

    move-result v2

    if-ne v1, v2, :cond_3

    .line 218
    iget-object v1, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->originalTracks:Ljava/util/List;

    invoke-interface {v1, v0}, Ljava/util/List;->remove(I)Ljava/lang/Object;

    goto :goto_3

    :cond_3
    add-int/lit8 v0, v0, 0x1

    goto :goto_2

    .line 221
    :cond_4
    :goto_3
    iget-object v0, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->tracks:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    .line 222
    invoke-virtual {p0}, Landroid/widget/ArrayAdapter;->notifyDataSetChanged()V

    return-void
.end method

.method public setFields(Ljava/util/List;)V
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;",
            ">;)V"
        }
    .end annotation

    .line 82
    iput-object p1, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->tracks:Ljava/util/List;

    .line 83
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0, p1}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V

    iput-object v0, p0, Llt/noframe/gpsfarmguide/adapters/TracksAdapterWithMap;->originalTracks:Ljava/util/List;

    return-void
.end method
